//
//  BKResultOfShangShiViewController.m
//  baokaodaxue
//
//  Created by dangyangyang on 15/6/2.
//  Copyright (c) 2015年 宏图教育. All rights reserved.
//

#import "BKResultOfShangShiViewController.h"
#import "BKShangShiTableViewCell.h"
#import "BKSegmentTextField.h"
#import <ReactiveCocoa.h>
#import <RACEXTScope.h>
#import "BKShangShiViewModel.h"
#import <MBProgressHUD.h>

static NSString *shangshi = @"shangshi";
@interface BKResultOfShangShiViewController ()<UITableViewDelegate,UITableViewDataSource>
@property (weak, nonatomic) IBOutlet UITableView *tableView;

@end

@implementation BKResultOfShangShiViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
    
    [_tableView registerNib:[UINib nibWithNibName:NSStringFromClass([BKShangShiTableViewCell class]) bundle:nil] forCellReuseIdentifier:shangshi];
    _tableView.separatorColor = [UIColor clearColor];
    _tableView.layer.borderColor = [[UIColor clearColor] CGColor];
    
    NSLog(@"dsa");

}

- (IBAction)p_back:(id)sender {
    [self.navigationController popViewControllerAnimated:YES];

}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
    NSLog(@"memory");
}


- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    NSLog(@"cell - %ld",indexPath.row);
    BKShangShiTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:shangshi];
    
    NSDictionary *array = _dataArray[indexPath.row];
    cell.zhiwu.text = array[@"zhiwei"];
    cell.xiaoyouming.text = array[@"name"];
    cell.gongsiming.text = array[@"gname"];
    NSNumber *number = array[@"zonge"];
    
    cell.zonge.text = [NSString stringWithFormat:@"%.03f",[number floatValue]];
    //cell.zonge.text = [number stringValue];
    
    
    
    if (indexPath.row % 2 == 0) {
        
        cell.backgroundColor = [UIColor clearColor];
        
    }else{
    
        cell.backgroundColor = [UIColor colorWithRed:0.910 green:0.965 blue:0.980 alpha:.8];
    }


    return cell;
}

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
    
    return 60;
}


- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    return [_dataArray count];
    
}
//- (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section{
//    return [UIView new];
//}
//
//- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section{
//
//    return 10;
//}

- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
{
    
    BKShangShiTableViewCell *cell = [[[NSBundle mainBundle] loadNibNamed:@"BKShangShiTableViewCell" owner:nil options:NULL] firstObject];
    cell.backgroundColor = [UIColor whiteColor];
    cell.zhiwu.text = @"职位";
    cell.xiaoyouming.text = @"校友名";
    cell.gongsiming.text = @"上市公司名";
    cell.zonge.text = @"年营业额总额";
    cell.backgroundColor = [UIColor colorWithRed:0.910 green:0.965 blue:0.980 alpha:1];
    return cell;
}

- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
{
    return 65;
}



@end
